*****************************************************
* analysis_table1.do
* Author: Elvis Bisong Tambe
* Purpose: Reproduce Table 1 – Mixed-Effects Linear Regressions
* Journal: Japanese Journal of Political Science (Accepted 2025)
*****************************************************

*--- Housekeeping ---
clear all
set more off

*--- Set working directory (portable for replication) ---
cd ".."   // Moves up one level from /code/ into main replication folder

*--- Load dataset ---
use "data/Afrobarometer_R9_clean_subset.dta", clear

*--- Verify successful load ---
describe

*=====================================================*
Mixed-Effects Linear Regressions (Table 1)
*=====================================================*

* Model 1: Perceived COVID-19 corruption only
mixed govt_mismanage_index covid_corr_perc, || COUNTRY:, covariance(unstructured)
est store m1
estat ic, n(42042) df(4)
 
* Model 2: Add individual-level controls
 mixed govt_mismanage_index covid_corr_perc i.Survey_year i.Age i.Gender i.Location Education lived_poverty i.lost_income_to_COVID_19 econ_condition inst_trust_index govt_corr_index bribery_experience, || COUNTRY:, covariance(unstructured)
 est store m2
 estat ic, n(33858) df(18)
 
* Model 3: Add country-level predictors
 mixed govt_mismanage_index covid_corr_perc i.Survey_year i.Age i.Gender i.Location Education lived_poverty i.lost_income_to_COVID_19 econ_condition inst_trust_index govt_corr_index bribery_experience V_DEM World_Bank_Governance_Indicators, || COUNTRY:, covariance(unstructured)
 est store m3
 estat ic, n(33858) df(20)
 
 Model 4: Cross-level interaction (COVID corruption × control of corruption)
mixed govt_mismanage_index covid_corr_perc i.Survey_year i.Age i.Gender i.Location Education lived_poverty i.lost_income_to_COVID_19 econ_condition inst_trust_index govt_corr_index bribery_experience V_DEM World_Bank_Governance_Indicators c.covid_corr_perc##c.World_Bank_Governance_Indicators, || COUNTRY:, covariance(unstructured) || covid_corr_perc:, covariance(unstructured)
est store m4
estat ic, n(33858) df(22)
 
  
 

